home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 46 / Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso / -in_the_mag- / reader_requests / scilab / tests / matqz.dia.ref < prev    next >
Text File  |  1999-09-16  |  578b  |  37 lines

  1.  
  2. Leps=1000*%eps;
  3.  
  4. //      gschur
  5.  
  6. a=rand(4,4);b=rand(4,4);[as,bs,qs,zs]=gschur(a,b);
  7.  
  8. if norm(qs*a*zs-as) > Leps then bugmes();quit;end
  9.  
  10. if norm(qs*b*zs-bs ) > Leps then bugmes();quit;end
  11.  
  12. //       gspec
  13.  
  14. b=eye(4,4);[al,be]=gspec(a,b);
  15.  
  16. if norm(al./be-spec(a) ) > Leps then bugmes();quit;end
  17.  
  18. //
  19.  
  20. clear a
  21.  
  22. a(8,8)=2;a(1,8)=1;a(2,[2,3,4,5])=[0.3,0.2,4,6];a(3,[2,3])=[-0.2,.3];
  23.  
  24. a(3,7)=.5;
  25.  
  26. a(4,4)=.5;a(4,6)=2;a(5,5)=1;a(6,6)=4;a(6,7)=2.5;a(7,6)=-10;a(7,7)=4;
  27.  
  28. b=eye(8,8);b(5,5)=0;
  29.  
  30. [al,be]=gspec(a,b);
  31.  
  32. [bs,as,q,n]=gschur(b,a,'disc');n-4
  33.  ans       =
  34.  
  35.     0.  
  36.  
  37.